<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <demo></demo>
        <async-comp></async-comp>
    </div>
    <script src="vue.js"></script>
    <script>
        Vue.component("demo", {
            template: `
            <h1>同步的组件</h1>
            `
        })
        Vue.component('async-comp', function (resolve, reject) {
            // 模拟请求
            setTimeout(function () {
                resolve({
                    template: '<h1>异步组件</h1>'
                })
            }, 3000)
        })
        let vm = new Vue({
            el: "#app",
            data: {

            },
            methods: {

            },


        })
    </script>
</body>

</html>